package com.gitee.wsl.platform.network

/**
 * Represents remote endpoint with [hostname] and [port].
 *
 * The address will be resolved after construction.
 *
 * @throws UnresolvedAddressException if the [hostname] cannot be resolved.
 */
actual abstract class NetworkAddress

/**
 * Represents remote endpoint with [hostname] and [port].
 *
 * The address will be resolved after construction.
 *
 * @throws UnresolvedAddressException if the [hostname] cannot be resolved.
 */
actual fun NetworkAddress(
    hostname: String,
    port: Int,
): NetworkAddress {
    TODO("Not yet implemented")
}

/**
 * Network address. Usually, it's an IP address in string form. This will not trigger a reverse lookup.
 */
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
actual val NetworkAddress.address: String
    get() = TODO("Not yet implemented")

/**
 * Network address port.
 */
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
actual val NetworkAddress.port: Int
    get() = TODO("Not yet implemented")

actual class UnresolvedAddressException actual constructor() : IllegalArgumentException()

/**
 * Network address hostname. This may trigger a reverse lookup.
 */
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
actual val NetworkAddress.hostname: String
    get() = TODO("Not yet implemented")